package com.jie.commonlib.support.eventbus;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;

/**
 *
 * @author ZDST-03
 * @date 2018/2/6
 * 定义eventBus的事件基类
 */
@Keep
public class Event<T> {

    private int code;
    private T data;

    public Event(@EventConstant int code) {
        this.code = code;
    }

    public Event(@EventConstant int code, T data) {
        this.code = code;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(@EventConstant int code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @NonNull
    @Override
    public String toString() {
        return "Event{" +
                "code=" + code +
                ", data=" + data +
                '}';
    }
}
